package com.ruoyi.hospital.service.shop.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.shop.ShopProductBrandsMapper;
import com.ruoyi.hospital.domain.shop.ShopProductBrands;
import com.ruoyi.hospital.service.shop.IShopProductBrandsService;

/**
 * 商品品牌Service业务层处理
 * 
 * @author wendao
 * @date 2024-08-19
 */
@Service
public class ShopProductBrandsServiceImpl implements IShopProductBrandsService 
{
    @Autowired
    private ShopProductBrandsMapper shopProductBrandsMapper;

    /**
     * 查询商品品牌
     * 
     * @param id 商品品牌主键
     * @return 商品品牌
     */
    @Override
    public ShopProductBrands selectShopProductBrandsById(Integer id)
    {
        return shopProductBrandsMapper.selectShopProductBrandsById(id);
    }

    /**
     * 查询商品品牌列表
     * 
     * @param shopProductBrands 商品品牌
     * @return 商品品牌
     */
    @Override
    public List<ShopProductBrands> selectShopProductBrandsList(ShopProductBrands shopProductBrands)
    {
        return shopProductBrandsMapper.selectShopProductBrandsList(shopProductBrands);
    }

    /**
     * 新增商品品牌
     * 
     * @param shopProductBrands 商品品牌
     * @return 结果
     */
    @Override
    public int insertShopProductBrands(ShopProductBrands shopProductBrands)
    {
        shopProductBrands.setCreateTime(DateUtils.getNowTimeSecond());
        return shopProductBrandsMapper.insertShopProductBrands(shopProductBrands);
    }

    /**
     * 修改商品品牌
     * 
     * @param shopProductBrands 商品品牌
     * @return 结果
     */
    @Override
    public int updateShopProductBrands(ShopProductBrands shopProductBrands)
    {
        shopProductBrands.setUpdateTime(DateUtils.getNowTimeSecond());
        return shopProductBrandsMapper.updateShopProductBrands(shopProductBrands);
    }

    /**
     * 批量删除商品品牌
     * 
     * @param ids 需要删除的商品品牌主键
     * @return 结果
     */
    @Override
    public int deleteShopProductBrandsByIds(Integer[] ids)
    {
        return shopProductBrandsMapper.deleteShopProductBrandsByIds(ids);
    }

    /**
     * 删除商品品牌信息
     * 
     * @param id 商品品牌主键
     * @return 结果
     */
    @Override
    public int deleteShopProductBrandsById(Integer id)
    {
        return shopProductBrandsMapper.deleteShopProductBrandsById(id);
    }
}
